/*
 * @Author: 谢陈洁
 * @Date: 2025-05-24 15:11:44
 * @LastEditors: 谢陈洁
 * @LastEditTime: 2025-07-30 16:04:58
 * @Description: file content
 */
// import nProgeress from 'nprogress'
import 'nprogress/nprogress.css' // 引入进度条样式
import { createRouter, createWebHistory} from 'vue-router'
import { constantRoutes } from './constantRoute'
import { dynamicRoutes } from './dynamicRoutes'
import { setupGuards } from './permission'

const router = createRouter({
  history: createWebHistory(import.meta.env.VITE_BASE_URL),
  // history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [...constantRoutes, ...dynamicRoutes], // 路由表
  strict: true, // 严格模式，确保所有路由路径都是唯一的
  scrollBehavior: () => ({ left: 0, top: 0 }) // 滚动行为，返回顶部
})

setupGuards(router)
export default router
